home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Auge 4000
/
Auge 4000 #47 (1990-06-22)(Amiga User Gruppe Einzugsgebiet 4000).zip
/
Auge 4000 #47 (1990-06-22)(Amiga User Gruppe Einzugsgebiet 4000).adf
/
arp-pro1.3
/
OLD_MANUAL
/
PatternMatch
< prev
next >
Wrap
Text File
|
1990-06-22
|
2KB
|
66 lines
PatternMatch(33.4) ARP Programmers Manual PatternMatch(33.4)
NAME
PatternMatch - perform a wildcard match on a string
SYNOPSIS
result = PatterMatch(pat,str)
D0 A0 A1
FUNCTION
This function compares a string to the given pattern and
determines if it is a valid match. If so it returns a true
result. If you are calling FindFirst()/FindNext() this
function, and the related PreParse() function are called for
you. You will need this function to do pattern matching on
arbitrary text, for example, in a Search command in a text
editor, or in implementing a 'grep' program. The pattern
must be constructed with special preparsed tokens and
supports the following patterns:
(p1|p2|p3) One of the patterns p1, p2 or p3
? Any single character
#<pat> Pattern repeated 0 or more times
[class] Character class0
~ NOT match on following pattern.
* 0 or more occurances of any character
INPUTS
char *pat - The pattern string to match against, this is
only partially ascii, the wildcard strings must be
converted to the appropriate token value as given in
the arpbase.[ih] files. The easiest way to do this
is to pass the string to PatternMatch() (V33 of
arp.library).
char *str - The string to be matched
RESULT
result - a boolean value indicating success/failure.
BUGS
Character classes still do not work.
SEE ALSO
PreParse(), FindFirst(), FindNext(), FreeAnchorChain()
AUTHOR
Original design by JAT. Rewritten for V39 by CDH.
Page 1 (printed 2/22/88)